<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        //1.基本解构数组使用 
        let arry = [1,2,3];
        let [a,b,c] = arry;
        //a = 1 b = 2 c = 3
        //数组解构的语法: let [变量名, 根据下角标位置] = 解构的数组
        //2.解构嵌套数组
        let [d,e,[f,[g]]]  = [1,3,[2,[3]]]
        //3. 忽律部分 前两个
        let [h,i] = [4,5,6]
        //从前向后
        //h = 4 i = 5 
        let [hh,,ii] = [4,5,6];
        //4. 默认值处理
        let [aa=6,bb=5] = [1];

        //5.剩余值 ... ...只能出现最后
        let [aaa,bbb,...ccc]  = [1,2,3,4,5,6]
        //aaa = 1 
        //bbb = 2
        //ccc = [3,4,5,6]

    </script>
</body>
</html>